#include "StdAfx.h"
#include "CCommandFunction.h"
#include "IConsoleScreen.h"


CCommandFunction::CCommandFunction( const csString & strName, FuncExecCallback *pFunc, 
								   const csString & strHelp /*= "unknown command." */ ) 
: CCommand(strName, strHelp)
, m_pFunction(pFunc)
{

}

CCommandFunction::~CCommandFunction()
{

}

bool CCommandFunction::Execute( IConsoleScreen *pScreen, const CArgumentList & args )
{
	if (m_pFunction)
		return (*m_pFunction)( pScreen, args );

	pScreen->PrintWarning( "register function pointer first." );
	return false;
}




